import {requestDelete, requestGet, requestPost, requestPut} from "@/api";

export const getWebhookList = () => {
    return requestGet('/api/pm/webhooks')
}

export const getWebhookById = (id:string) => {
    return requestGet('/api/pm/webhook/'+id)
}


export const saveWebhook = (data?:any) => {
    return requestPost("/api/pm/webhook",data)
}

export const updateWebhook = (data?:any) => {
    return requestPut("/api/pm/webhook",data)
}
export const deleteWebhook = (id:string) => {
    return requestDelete("/api/pm/webhook/"+id)
}

export const getLogsByWebhookId = (id:string) => {
    return requestGet('/api/pm/webhook/'+id+ "/logs")
}

// export const useOrgApi = (id: Number) => {
// 	return service.get('/pm/org/' + id)
// }
//
// export const deleteApi = (id?:string) => {
// 	return service.get('/pm/org/delete/' + id)
// }
//
// export const useOrgSubmitApi = (dataForm: any) => {
// 	if (dataForm.id) {
// 		return service.post('/pm/org/save', dataForm)
// 	} else {
// 		return service.post('/pm/org/save', dataForm)
// 	}
// }
